package xyz.riceball.job.listener;

import lombok.extern.slf4j.Slf4j;
import org.quartz.*;
import org.quartz.listeners.SchedulerListenerSupport;

/**
 * <p>
 *
 * </p>
 *
 * @author xiaovcloud
 * @since 2022/6/16 22:50
 */
@Slf4j
public class RbSchedulerListener extends SchedulerListenerSupport {

    public void jobAdded(JobDetail jobDetail) {
        log.info("jobAdded");
    }

    public void jobDeleted(JobKey jobKey) {
        log.info("jobDeleted");
    }

    /**
     * 任务停止
     *
     * @param jobKey
     */
    public void jobPaused(JobKey jobKey) {
        String group = jobKey.getGroup();
        String name = jobKey.getName();
        log.info("jobPaused");
    }

    /**
     * 任务重启
     *
     * @param jobKey
     */
    public void jobResumed(JobKey jobKey) {
        String group = jobKey.getGroup();
        String name = jobKey.getName();
        log.info("jobResumed");
    }

    /**
     * 开始调度
     *
     * @param trigger
     */
    public void jobScheduled(Trigger trigger) {
        log.info("jobScheduled");
    }

    public void jobsPaused(String jobGroup) {
        log.info("jobsPaused");
    }

    public void jobsResumed(String jobGroup) {
        log.info("jobsResumed");
    }

    /**
     * 停止调度
     *
     * @param triggerKey
     */
    public void jobUnscheduled(TriggerKey triggerKey) {
        log.info("jobUnscheduled");
    }

    public void schedulerError(String msg, SchedulerException cause) {
        log.info("schedulerError");
    }

    public void schedulerInStandbyMode() {
        log.info("schedulerInStandbyMode");
    }

    public void schedulerShutdown() {
        log.info("schedulerShutdown");
    }

    public void schedulerShuttingdown() {
        log.info("schedulerShuttingdown");
    }

    public void schedulerStarted() {
        log.info("schedulerStarted");
    }

    public void schedulerStarting() {
        log.info("schedulerStarting");
    }

    public void triggerFinalized(Trigger trigger) {
        log.info("triggerFinalized");
    }

    /**
     * trigger停止调度
     *
     * @param triggerKey
     */
    public void triggerPaused(TriggerKey triggerKey) {
        log.info("triggerPaused");
    }

    public void triggerResumed(TriggerKey triggerKey) {
        log.info("triggerResumed");
    }

    public void triggersPaused(String triggerGroup) {
        log.info("triggersPaused");
    }

    public void triggersResumed(String triggerGroup) {
        log.info("triggersResumed");
    }

    public void schedulingDataCleared() {
        log.info("schedulingDataCleared");
    }

}
